<!DOCTYPE html>
<html lang="en" xml:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Login Page</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f4f4f4;
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            min-height: 1000px; /* 增加最小高度，避免内容较少时界面过小 */
        }
        .login-container {
            background-color: #fff;
            /* 调整容器尺寸 */
            min-width: 400px; /* 最小宽度 */
            max-width: 600px; /* 最大宽度，适应不同屏幕 */
            padding: 40px;
            border-radius: 10px;
            box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
        }
        .form-group {
            margin-bottom: 25px;
        }
        .form-group label {
            display: block;
            margin-bottom: 5px;
        }
        .form-group input {
            width: 100%;
            padding: 15px;
            border: 1px solid #ddd;
            border-radius: 5px;
            box-sizing: border-box; /* ensures padding doesn't affect width */

        }
        .form-group input[type="submit"] {
            background-color: #5c79b8;
            color: white;
            cursor: pointer;
            padding: 15px 50px; /* 增大按钮尺寸 */
            font-size: 1.1em; /* 增大按钮字体 */
            border-radius: 8px; /* 按钮圆角 */
        }
        .form-group input[type="submit"]:hover {
            background-color: #4cae97;
        }
    </style>
</head>
<body>
<div class="login-container">
    <h2 style="text-align: center; margin-bottom: 30px;">自定义登录页面</h2> <!-- 居中标题并增加间距 -->
    <!-- 显示错误信息 -->
    <div th:if="${session.errorMessage}" style="color:red;">
        <p th:text="${session.errorMessage}"></p>
        <!-- 清除错误信息，避免刷新页面后仍然显示 -->
        <script>
            sessionStorage.removeItem('errorMessage');
        </script>
    </div>
    <form th:action="@{/login}" method="post">
        <div class="form-group">
            <label for="userName">用户名:</label>
            <input type="text" id="userName" name="userName" required>
        </div>

        <div class="form-group">
            <label for="passWord">密码:</label>
            <input type="password" id="passWord" name="passWord" required>
        </div>

        <div class="form-group">
            <input type="submit" value="Log In">
        </div>
    </form>
</div>
</body>
</html>
